fix: restore green master CI (format, clippy, identity-cutover fail-closed) - #738
Conversation
Fixes the Format check: tests/storage_suite/storage_resolver_test.rs was merged with two rustfmt violations (lines 1902 and 2033). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A2BarcJk3iuv77aJQwHvnx
Fixes the Clippy check: clippy::if-same-then-else fired on two arms that both return parent.parent()?. Merging the conditions with || is semantically identical. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A2BarcJk3iuv77aJQwHvnx
Fixes the two tests failing on Linux, macOS, and Windows shards 2/5: doctor::tests::current_project_store_surfaces_split_identity_conflict and cli_non_interactive_test::status_surfaces_split_identity_conflict_without_suggesting_init. Commit 133ca5c made a populated exact-root selected store outrank legacy duplicates without probing them, so a genuine identity cutover (two populated shards whose manifests both name this exact root) resolved silently to the marker-selected shard instead of failing closed with the consolidation guidance. Keep the bounded-presence fast path, but probe exact-root candidates first: junk or empty duplicates are still ignored (registered_healthy_exact_root_ignores_duplicate_exact_manifests keeps passing), while a populated exact-root duplicate falls through to the identity-cutover conflict diagnostics. Also applies the pending rustfmt fix in this file (Format check flagged line 229). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A2BarcJk3iuv77aJQwHvnx
|
CI clippy aborted at the tracedecay-runtime-core error, so the root crate was never linted. With that fixed, five pre-existing pedantic violations surface: single_match_else in the scheduler shutdown, manual let-else and match_same_arms in the store-identity probes, fn_params_excessive_bools on choose_identity_layout (allowed: the flags mirror resolver evidence from the sole caller), and items_after_statements in a consolidate test. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A2BarcJk3iuv77aJQwHvnx
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 776c779b09
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if store_identity_has_bounded_population_evidence(candidate).await { | ||
| exact_candidate_is_populated = true; | ||
| break; |
There was a problem hiding this comment.
Treat unreadable exact candidates as conflicts
When an exact-root candidate retains real auxiliary data but its graph database is missing or corrupt, store_identity_has_bounded_population_evidence returns false immediately without checking sessions or artifacts; it likewise returns false when a populated graph has any unreadable auxiliary path. The new loop therefore classifies these non-pristine candidates as empty and returns the selected layout at line 298, bypassing the inventory-based identity-cutover conflict that would preserve fail-closed behavior. Treat probe errors as conflicting evidence, or otherwise distinguish a genuinely pristine/junk candidate from an unreadable one before taking the fast path.
Useful? React with 👍 / 👎.
Absorbs the master-side CI stabilization. Delete-side conflicts resolve to this branch: the V2 resolver (lifecycle/identity.rs reject_split_identity_cutover) already fails closed on populated duplicate shards, path_layout.rs is already restructured past the clippy lint, and the automation lock code is rewritten here (the vanished-lock reclaim guard from #739 still needs a V2 port — see the PR #707 comment from 2026-08-27). Tree is identical to the previous branch head. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A2BarcJk3iuv77aJQwHvnx
Fix every failing master baseline check
Master's CI has been red since Aug 19 with a stable failure set: Format, Clippy, Test Linux, Test macOS, Test Windows shards 2/5 and 5/5. All four test-job failures are the same two tests. This PR fixes each root cause in its own commit.
1. Format —
style(storage): apply rustfmt to resolver tests+ part of commit 3tests/storage_suite/storage_resolver_test.rs(lines 1902/2033) andsrc/tracedecay/lifecycle.rs(line 229) merged with rustfmt violations.cargo fmt --all -- --checkpasses after this.2. Clippy —
fix(db): deduplicate identical branch arms in profile_project_rootclippy::if-same-then-elseincrates/tracedecay-runtime-core/src/db/access/path_layout.rs: two arms both returnedparent.parent()?. Conditions merged with||, semantically identical.3. The two failing tests —
fix(storage): fail closed on populated exact-root duplicate storesdoctor::tests::current_project_store_surfaces_split_identity_conflictandcli_non_interactive_test::status_surfaces_split_identity_conflict_without_suggesting_initfail identically on Linux, macOS, and Windows (shards 2 and 5).Root cause: commit
133ca5c48b("perf(storage): trust healthy exact root among duplicates", landed Aug 10 via the #506 branch) changedchoose_identity_layout's fast path fromselected_is_sole_exact_roottoselected_manifest_matches_exact_root— the selected store now wins without ever probing the duplicates. Its new regression test only covers garbage duplicates, but the two older tests (and #506's own description: "genuinely ambiguous stores continue to fail closed") pin the contract that a populated exact-root duplicate is a genuine identity cutover that must fail closed withtracedecay migrate consolidateguidance.Fix: keep the bounded-presence fast path, but when candidates also match the exact root, probe them first (same bounded
store_identity_has_bounded_population_evidenceprobe — no full inventories on the fast path):registered_healthy_exact_root_ignores_duplicate_exact_manifestsand the branch/alias variants keep passing);The downstream
src/display.rs:154debug_assert panic seen in the CLI test disappears with this:statusfails closed before printing a table for a half-resolved store.Verification
cargo fmt --all -- --check— passcargo clippy --workspace --all-targets --locked -- -D warnings— running locally, mirrored by this PR's Clippy jobstorage_suiteresolver tests (incl. the 133ca5c regression tests), and the CLI status-conflict test — running locally, mirrored by this PR's test jobsExpected: this PR's own checks are the authoritative proof — every previously failing check should go green here with no new failures.